<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>一秒输出两个</title>
</head>
<body>

<script>
    var a=[1,2,3,4,5,6,7,8,9,10];
    var i=0;
    var timer=setInterval(function(){
        console.log(a[i],a[i+1]);
        i=i+2;
        if(i>a.length-1){
            clearInterval(timer);
        }
    },1000);


</script>
</body>
</html>